package com.pankai.cn.utils;

import java.util.UUID;

/**
 * @author pankai
 * @create 2020-12-02 13:38
 */
public class SaltUtils {

    /**
     * 生成UUID
     * @return
     */
    public static String getUUID() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }

    public static String getSalt(int n){
        String salt = getUUID().substring(0, n);
        return salt;
    }


    public static void main(String[] args) {
        System.out.println(getSalt(8));
    }

}
